﻿using M_Quality.API.Application.Command.RawMaterialQualityCommand;
using M_Quality.Repository.Interface;
using MediatR;

namespace M_Quality.API.Application.CommandHandler.RawMaterialQualityCommandHandler
{
    public class UpdRMQCommandHandler : IRequestHandler<UpdRMQCommand, int>
    {
        private readonly IRawMaterialQualityRepository repository;

        public UpdRMQCommandHandler(IRawMaterialQualityRepository repository)
        {
            this.repository = repository;
        }

        public async Task<int> Handle(UpdRMQCommand request, CancellationToken cancellationToken)
        {
            return await repository.UpdateAsync(request);
        }
    }
}
